if we are going to need modified permissions: always change
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Fri, 4 Apr 2025 09:09:38 +0000 (11:09 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Mon, 7 Apr 2025 10:53:38 +0000 (10:53 +0000)
we might need to change the permissions, so do it instead of trying to
be smart

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/libsync/filesystem.cpp

index 580562acc3d4913e804442ba796d945a2ae69a97..ecf950fe34e2cbde25d5c6546b85475dd272ab83 100644 (file)
@@ -535,8 +535,8 @@ FileSystem::FilePermissionsRestore::FilePermissionsRestore(const QString &path,
         _initialPermissions = FileSystem::isFolderReadOnly(stdStrPath) ? OCC::FileSystem::FolderPermissions::ReadOnly : OCC::FileSystem::FolderPermissions::ReadWrite;
         if (_initialPermissions != temporaryPermissions) {
             _rollbackNeeded = true;
-            FileSystem::setFolderPermissions(_path, temporaryPermissions);
         }
+        FileSystem::setFolderPermissions(_path, temporaryPermissions);
     }
     catch (const std::filesystem::filesystem_error &e)
     {